﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Protoss
{
	public class ActionProduceAssimilator : ActionProduceFromProbe
	{

		public static ActionProduceAssimilator Instance = new ActionProduceAssimilator();

		private ActionProduceAssimilator() : base(30, 75, 0) { }

		public override ProtossState.ProtossBuilding GetBuilding(ProtossState state) { return state.Assimilator; }
		public override string EventName { get { return "ActionSpawnAssimilator"; } }
		public override bool HaveTechnology(IBuildOrder bo) { return true; }
		public override bool HaveResources(IBuildOrder bo)
		{
			ProtossState state = bo.State as ProtossState;
			return base.HaveResources(bo) && state.Assimilator.Total + 1 <= bo.State.Bases.Total * 2;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			ProtossState state = bo.State as ProtossState;
			return state.Assimilator.Total + 1 > bo.State.Bases.Total * 2;
		}
	}
}
